home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE06 / VBX / CHRTFXEX.PAS next >
Encoding:
Pascal/Delphi Source File  |  1996-01-02  |  2.5 KB  |  104 lines

  1. unit ChrtFXEx ;
  2. (*****) interface (*******************************)
  3. uses
  4.   SysUtils, 
  5.   WinTypes, 
  6.   WinProcs, 
  7.   Messages, 
  8.   Classes, 
  9.   Graphics, 
  10.   Controls,
  11.   Forms, 
  12.   Dialogs,
  13.   Menus,
  14.   ChartFX,   {import unit for ChartFX constants and function prototypes}
  15.   CustChrt ; {abstract ChartFX VBX wrapper unit } 
  16.  
  17. type 
  18.   tcfxGridType = ( cfxNoGrid, cfxHorzGrid, cfxVertGrid, cfxBothGrid ) ;
  19.  
  20. type
  21.   TChart2FXEx = class( TCustChart )
  22.     (**)private(**)
  23.       function GetBorderStyle : TBorderStyle ;
  24.       procedure SetBorderStyle( Value : TBorderStyle ) ;
  25.       function GetGrid : tcfxGridType ;
  26.       procedure SetGrid( Value : tcfxGridType ) ;
  27.     (**)protected(**)
  28.     (**)public(**)
  29.     (**)published(**)
  30.     property BorderStyle: TBorderStyle 
  31.       read GetBorderStyle 
  32.       write SetBorderStyle
  33.       default bsSingle ;
  34.  
  35.     property Grid : tcfxGridType 
  36.       read GetGrid
  37.       write SetGrid
  38.       default cfxNoGrid ;
  39.  
  40.     property Align ;
  41.     property Hint ;
  42.     property PopupMenu ;
  43.     property ParentShowHint ;
  44.  
  45.     property TabOrder ;
  46.     property TabStop ;
  47.  
  48.     property OnClick ;
  49.     property OnMouseDown ;
  50.     property OnMouseUp ;
  51.     property OnMouseMove ;
  52.     property OnRButtonDown ;
  53.   end;
  54.  
  55. procedure Register;
  56.  
  57. (*****) implementation (**************************)
  58.  
  59. function TChart2FXEx.GetBorderStyle : TBorderStyle ;
  60. begin
  61.   case inherited BorderStyle of
  62.     0 : Result := bsNone ;
  63.     1 : Result := bsSingle ;
  64.   end (* case *) ;
  65. end ;
  66.  
  67. procedure TChart2FXEx.SetBorderStyle( Value : TBorderStyle ) ;
  68. begin
  69.   case Value of
  70.     bsNone   : inherited BorderStyle := 0 ;
  71.     bsSingle : inherited BorderStyle := 1 ;
  72.   end (* case *) ;
  73. end ;
  74.  
  75. function TChart2FXEx.GetGrid : TcfxGridType ;
  76. begin
  77.   case inherited Grid of
  78.     CHART_NOGRID   : Result := cfxNoGrid ;
  79.     CHART_HORZGRID : Result := cfxHorzGrid ;
  80.     CHART_VERTGRID : Result := cfxVertGrid ;
  81.     CHART_BOTHGRID : Result := cfxBothGrid ;
  82.   end (* case *) ;
  83. end ;
  84.  
  85. procedure TChart2FXEx.SetGrid( Value : TcfxGridType ) ;
  86. begin
  87.   case Value of
  88.     cfxNoGrid   : inherited Grid := CHART_NOGRID ;
  89.     cfxHorzGrid : inherited Grid := CHART_HORZGRID ;
  90.     cfxVertGrid : inherited Grid := CHART_VERTGRID ;
  91.     cfxBothGrid : inherited Grid := CHART_BOTHGRID ;
  92.   end (* case *) ;
  93. end ;
  94.  
  95. procedure Register;
  96. begin
  97.   RegisterComponents( 'VBX', [TChart2FXEx] );
  98. end;
  99.  
  100. initialization
  101.     (* unit ChrtFXEx  -- initialization code *)
  102.   (* NONE *)
  103. end (* unit ChrtFXEx  -- initialization code *) .
  104.